# def avg_score(name , shuxue , yuwen,tiyu=60,*args, **kwargs):
#     # print(f"kwargs收到的中容是:{kwargs} , kwargs的类型是{type(kwargs)]") # kwargs收到的是什么?
#     avg=(shuxue+yuwen+tiyu+sum(args)+sum(kwargs.values()))/(3+len(args)+len(kwargs))
#     print(avg)
#     # return avg#返回平均值
#
#
# print('*'*100)
#
# avg_score('小明',60,70,80,50,30,waiyu=100,huaxue=80)
# # print(f'计算的结果是{result:.3f}')


# b=0
# def test():
#     b=236556
#
#     print(b)
# test()
# print(b)
#
# c=0
# def test():
#     global c
#     a=b
#     c+=1
#     print(c)
# test()
# print(c)


# 根据成绩的高低排序
# dic = [{"name":"tom","score":90}, {"name":"alice","score":86},{"name":"amil","score":92}]
# dic.sort(key=lambda x:x['score'])
# print(dic)


# number = 998
# def sum_total(n):
#     if n == 1:
#         return 1
#     else:
#         return n + sum_total(n - 1)
# print(sum_total(number) )

# import time
# import datetime
# now=time.strftime('%Y-%m-%d %H:%M:%S')
# print(now)
#
# d1=datetime.datetime.strptime('2021-01-28 14:27:35','%Y-%m-%d %H:%M:%S')
# d2=datetime.datetime.strptime('2021-01-29 14:30:55','%Y-%m-%d %H:%M:%S')
# delta=d2-d1
# print(delta)  # 打印相差多少天 day+second
# print(delta.days)  # 打印days
# print(delta.seconds)  # 打印seconds
#
# delta1=datetime.timedelta(days=8)
# delta2=datetime.timedelta(seconds=-60)
# that=d1+delta1
# that1=d1+delta2
# print(that,that1)


# def sum_score(*args,**kwargs):
#     result=sum(args)+sum(kwargs.values())
#     print(result)
#
# yw=80
# sx=90
# ty=100
# other=(50, 60, 70)
# # other=[50,60, 70]
# more={"meishu":80,"yinyue":90}
# #result = sum_score(yw ,sx , ty ,*other ,more) #想要的是 sum_score(yw , sx , ty , *other ,美术=80,音乐=90)
# # result = sum_score(gw ,sx , ty , other ,meishu=80 yinyue=90)#如果能把more变成meishu-=80 ,yinyue=90就可以解决问题
# # 解决
# # result = sum_score(yw,sx,ty,*other,**more)
# #more前面的**﹑只是脱掉字典外面的膏而已。
# # print("我的成绩是",result)
# sum_score(80,90,100)
# sum_score(*other)
# sum_score(**more)


# tom=(85,90)
# alix={'数学':80,'语文':95,'英语':95}
#
# def avg_score(*args, **kwargs):
#     # print(f"kwargs收到的中容是:{kwargs} , kwargs的类型是{type(kwargs)]") # kwargs收到的是什么?
#     avg=(sum(args)+sum(kwargs.values()))/(len(args)+len(kwargs))
#     print(avg)
#     # return avg#返回平均值
#
# avg_score((85,90))


# a = [1,2,3]
# def mytest():
#     a.append(4) # 突破了不能修改global变量的现象
#     print(f"mytest函数里面的a是{a}")
#     def mytest_inner():
#         a.append(5)
#         print(f"mytest_inner里面的a 是 {a}")
#
#     mytest_inner()
# mytest()
# print(f"函数外面的a是{a}")
#
#
# #使用场景1:排序
# a=[(1,9),(4,6),(2,8),(3,721)]
# #排序规则:根据第二个值来排
# a.sort(key=lambda x:x[1])
# print(a)


# 递归函数：求100内的和
# number = 100
# def sum_total(n):
#     if n == 1:
#         return 1
#     else:
#         return n+sum_total(n - 1)
# print(sum_total(number))


# 递归函数：求100内的和
# a = [1,2,[1,2,3],[1,2],[1,2,3,[1,2,[1,2]]]]# 有多少个1?
# def count1(li,number):
#     if isinstance(li, list):
#         total = li.count(number)
#         for i in li:
#             total += count1(i,number)
#         return total
#     else:
#         return 0
# print(count1(a,1))



def f(a,b=10):
    print(a+b)

f(b=4,a=3)



















